package com.db.stockexchange.common.messages.server;

import com.db.stockexchange.common.messages.MessageType;

public class RejectedMessage extends ServerMessage {
	private int rejectReason;
	private String detailReason;
	
	public RejectedMessage(int rejectReason, String detailReason) {
		this(rejectReason, detailReason, "");
	}
	
	public RejectedMessage(int rejectReason,
			String detailReason, String senderCompID) {
		super(MessageType.REJECT, senderCompID);
		this.rejectReason = rejectReason;
		this.detailReason = detailReason;
	}

	public int getRejectReason() {
		return rejectReason;
	}

	public String getReasonDetail() {
		return detailReason;
	}
	
	@Override
	public String toString() {
		return new StringBuilder().append(super.toString())
				.append(" <").append(detailReason).append(">").toString();
	}
}
